<template>
	<view>
		<u-tabbar v-model="current" :list="list" :mid-button="true" height="100" active-color="#3C83FF" @change="code()"></u-tabbar>
	</view>
</template>

<script>
	import {getActivity,dec}from '@/api/activity/activity.js'
	export default {
		data() {
			return {
				list: [{
					iconPath: require("@/static/img/sy.png"),
					selectedIconPath: require("@/static/img/sy1.png"),
					text: '活动报名',
					count: 0,
					isDot: false,
					customIcon: false,
					pagePath:"/pages/tabBar/home/home"
				},
				{
					iconPath: require("@/static/img/sys.png"),
					selectedIconPath:require("@/static/img/sys.png"),
					text: '',
					midButton: true,
					customIcon: false,
					// "pagePath": "/pages/tabBar/activity/activity",
				},
				{
					iconPath: require("@/static/img/wd.png"),
					selectedIconPath:require("@/static/img/wd1.png"),
					text: '个人中心',
					count: 0,
					isDot: false,
					customIcon: false,
					"pagePath": "/pages/tabBar/my/my",
				},
			],
			current: 0
			}
		},
		methods: {
			code(index){
				if(index==1){
					// 允许从相机和相册扫码
					uni.scanCode({
						success: function (res) {
							console.log('条码类型：' + res.scanType);
							console.log(res);
							if(res.path){
								uni.navigateTo({
									url: res.path,
									complete(res){
										console.log(res)
									}
								})
							}	
						}
					});
				}
			}
		}
	}
</script>

<style>

</style>
